import instance from '../api.js'
export function userLogin(username,password){
        return instance({
            method:'GET',
            url:`/user/login?username=${username}&password=${password}`

        })
}
export function text(){
    return instance({
        method:'GET',
        url:'/user/login/test'
    })
}
export function updataUser(params){
    return instance.post('/user/login/updata',params)
}

export function Useradd(params){
    return instance.post('/user/login/useradd',params)
}

export function Getalluser(){
    return instance.post('/user/login/getalluser')
}
export function UserDelete(id){
    return instance.post('/user/login/userdelete',{id:id})
}
export function Useredit(params){
    return instance.post('/user/login/useredit',params)
}
export function AddNews(params){
    return instance.post('/news/newsadd',params)
}
export function GetAllNews(){
    return instance.post('/news/getallnews')
}
export function isPublish(params){
    return instance.post('/news/isPublish',params)
}
export function NewDelete(params){
    return instance.post('/news/newdelete',params)
}
export function NewEdit(params){
    return instance.post('/news/NewEdit',params)
}
export function AddProduct(params){
    return instance.post('/product/AddProduct',params)
}
export function GetAllProduct(){
    return instance.post('/product/GetAllProduct')
}
export function EditProduct(params){
    return instance.post('/product/editproduct',params)
}
export function DeleteProduct(params){
    return instance.post('/product/deleteproduct',params)
}
export function GetnewsList(){
    return instance.post('/newsweb/getnewslist')
}
export function searchnews(keyword){
    return instance.post('/newsweb/searchnews',keyword)
}
export function getnewnewslist(limit){
    return instance.post('/newsweb/getnewnewslist',{limit:limit})
}
export function getallproduct(){
    return instance.post('/newsweb/getallproduct')
}